package Tools;

import com.fs.zise.ZiSeActivity;

import android.content.SharedPreferences;

public class MyFee {

	private static MyFee myFee;
	public static int MAX_TRY_TIMER = 8;
	private int try_timer = 0;
	private static String TryName = "XiaWeiYiMiQing";
	private boolean b_Paid = false;

	public static MyFee getSingleInstance() {
		if (myFee == null)
			myFee = new MyFee();
		return myFee;
	}

	public int getTry_timer() {
		return try_timer;
	}

	public void setTry_timer(int try_timer) {
		this.try_timer = try_timer;
	}

	public boolean get_tryPaid() {
		return b_Paid;
	}

	public void set_tryPaid(boolean b_Paid) {
		this.b_Paid = b_Paid;
	}

	public void load_tryPaidData() {
		SharedPreferences settings = ZiSeActivity.getActivity()
				.getSharedPreferences(TryName,
						android.content.ContextWrapper.MODE_PRIVATE);
		b_Paid = settings.getBoolean("b_paid", b_Paid);
		try_timer =  settings.getInt("try_timer", try_timer);
		System.out.println("加载试玩记录");
	}

	public void save_tryPaidData() {
		android.content.SharedPreferences settings = ZiSeActivity.getActivity()
				.getSharedPreferences(TryName,
						android.content.ContextWrapper.MODE_PRIVATE);
		SharedPreferences.Editor editor = settings.edit();
		editor.putBoolean("b_paid", b_Paid);
		editor.putInt("try_timer", try_timer);
		
		editor.commit();
		System.out.println("保存试玩记录");
	}

}
